
var dayjs = require("dayjs")

export const filters = {
    noData: value => {
      return value === null || value === '' ||  value === 'None' || value === undefined  ? '-' : value ;
    },
    time: value => {
        return dayjs(value).format("YYYY-MM-DD HH:mm:ss")
    },
	warn_source: value => {
		switch (value) {
			case "1":
				return "阈值告警";
				break;
			case "2":
				return "动态阈值";
				break;
			case "3":
				return "趋势告警";
				break;
			case "4":
				return "AI模型";
				break;
			case "5":
				return "设备机理";
				break;
		}
	},
	notice: value => {
        switch (value) {
            case -1:
                return '已忽略'
              break;
            case 0:
              return '未生成工单'
              break;
            case 1:
              return '已生成工单'
              break;
            case 2:
              return '工单已处理'
              break;
          }
	}
}
